package com.kotlin.flong.coroutines1

import kotlinx.coroutines.async
import kotlinx.coroutines.runBlocking

/**
 * @Author:liangjl
 * @Date: 2020/7/8-20:55
 * @Eamil:jilongliang@sina.com
 * @Description:
 * VM options --> -Dkotlinx.coroutines.debug
 */
private fun log(logMsg: String) = println("${Thread.currentThread().name} $logMsg")

fun main() = runBlocking<Unit> {

    var msg1 = async {
        log("this is msg1 ")
        "kotlin1"
    }
    var msg2 = async {
        log("this is msg2 ")
        "kotlin2"
    }

    log("The result ${msg1.await() + "," + msg2.await()}")

}